<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
 		<title></title>
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<jsp:include page="/page/front/include.jsp"></jsp:include>
		<link rel="stylesheet" type="text/css" href="css/front/user_center.css" />
	</head>
	<body class="memberCenter">
		<jsp:include page="/page/front/header.jsp"></jsp:include>
		<div class="body orderList">
			<div class="bodyLeft">
				<jsp:include page="/page/front/user_left_menu.jsp"></jsp:include>
			</div>
			<div class="bodyRight">
				<div class="memberCenterDetail">
					<div class="top">订单详情</div>
					<div class="middle">
						<div class="blank"></div>
						<div class="operationInfo">
							<strong class="green">订单状态 [订单编号：<s:property value="orderShow.orderID" />]</strong>
							<s:set name="status" value="orderShow.status"></s:set>
							<form action="operateOrder.do" method="post">
								<s:if test="#status==0">
								<p class="red">用户已提交订单，等待发货</p>
								<input type="hidden" name="id" value='<s:property value="orderShow.orderID" />' />
								<input type="hidden" name="code" value="1" />
								<input type="submit" value="取消订单" class="formButton" />
								</s:if><s:elseif test="#status==1">
								<p class="red">用户已取消订单</p>
								</s:elseif><s:elseif test="#status==2">
								<p class="red">订单处理完成，图书已发出</p>
								<input type="hidden" name="id" value='<s:property value="orderShow.orderID" />' />
								<input type="hidden" name="code" value="3" />
								<input type="submit" value="确认收货" class="formButton" />
								</s:elseif><s:elseif test="#status==3">
								<p class="red">图书已送达，交易成功</p>
								</s:elseif><s:else>
								<p class="red">图书未送达，交易失败</p>
								</s:else>
							</form>
						</div>
						<div class="blank"></div>
						<table class="listTable">
							<tbody>
								<tr>
									<th>订单日志</th>
								</tr>
								<tr class="orderProcess">
									<td>
										<div class="orderSubmit">
											<p class="name">订单提交</p>
											<p><s:property value="orderShow.submitTime" /></p>
										</div>
									<s:if test="#status==0">
										<div class="orderDispatchWait">
											<p class="name">书店发货</p>
											<p><br><br></p>
										</div>
										<div class="orderCompleteWait">
											<p class="name">确认收货</p>
											<p><br><br></p>
										</div>
									</s:if><s:elseif test="#status==1">
										<div class="orderCompleteAlready">
											<p class="name">订单取消</p>
											<p><s:property value="orderShow.confirmTime" /></p>
										</div>
									</s:elseif><s:elseif test="#status==2">
										<div class="orderDispatchAlready">
											<p class="name">书店发货</p>
											<p><s:property value="orderShow.dispatchTime" /></p>
										</div>
										<div class="orderCompleteWait">
											<p class="name">确认收货</p>
											<p><br><br></p>
										</div>
									</s:elseif><s:elseif test="#status==3">
										<div class="orderDispatchAlready">
											<p class="name">书店发货</p>
											<p><s:property value="orderShow.dispatchTime" /></p>
										</div>
										<div class="orderCompleteAlready">
											<p class="name">订单完成</p>
											<p><s:property value="orderShow.confirmTime" /></p>
										</div>
									</s:elseif><s:else>
										<div class="orderDispatchAlready">
											<p class="name">书店发货</p>
											<p><s:property value="orderShow.dispatchTime" /></p>
										</div>
										<div class="orderCompleteAlready">
											<p class="name">订单失败</p>
											<p><s:property value="orderShow.confirmTime" /></p>
										</div>
									</s:else>
									</td>
								</tr>
							</tbody>
						</table>
						<div class="blank"></div>
						<table class="listTable">
							<tbody>
								<tr>
									<th style="width:80px;">收货信息</th>
									<th></th>
									<th style="width:80px;"></th>
									<th></th>
								</tr>
								<tr>
									<td class="title">收&ensp;货&ensp;人：</td>
									<td><s:property value="orderAddress[0]" /></td>
									<td class="title">收货地区：</td>
									<td><s:property value="orderAddress[1]" /></td>
								</tr>
								<tr>
									<td class="title">收货地址：</td>
									<td><s:property value="orderAddress[2]" /></td>
									<td class="title">邮&emsp;&emsp;编：</td>
									<td><s:property value="orderAddress[3]" /></td>
								</tr>
								<tr>
									<td class="title">联系电话：</td>
									<td><s:property value="orderAddress[4]" /></td>
								</tr>
							</tbody>
						</table>
						<div class="blank"></div>
						<table class="listTable">
							<tbody>
								<tr>
									<th style="width: 70px;">图书名称</th>
									<th></th>
									<th style="width:80px;">购买价格</th>
									<th style="width:60px;">购买数量</th>
									<th style="width:80px;">小计</th>
								</tr>
								<s:set name="totalQuantity" value="0"></s:set>
								<s:set name="totalCharge" value="0"></s:set>
								<s:iterator value="orderBooks">
								<tr>
									<s:set name="bookID" value="book.bookID"></s:set>
									<td>
										<a href='viewBook.do?id=<s:property value="#bookID" />' target="_blank">
											<img width="70px" height="70px" src='<s:property value="book.picPath" />'>
										</a>
									</td>
									<td>
										<a href='viewBook.do?id=<s:property value="#bookID" />' target="_blank">
											<s:property value="book.title" />
										</a>
									</td>
									<s:set name="itemPrice" value="price"></s:set>
									<td>￥<s:property value="#itemPrice" /></td>
									<s:set name="itemQuantity" value="quantity"></s:set>
									<s:set name="itemCharge" value="#itemPrice*#itemQuantity"></s:set>
									<td><span class="subtotalPrice">￥<s:property value="#itemCharge" /></span></td>
									<s:set name="totalQuantity" value="#totalQuantity+#itemQuantity"></s:set>
									<s:set name="totalCharge" value="#totalCharge+#itemCharge"></s:set>
								</tr>
								</s:iterator>
								<tr>
									<td class="summary" colspan="5">
										订单商品共计：<span class="red"><s:property value="orderBooks.size" /></span>种
										，<span class="red"><s:property value="#totalQuantity" /></span>件
										；订单总金额：<span class="red">￥<s:property value="#totalCharge" /></span>元
									</td>
								</tr>
							</tbody>
						</table>
						<div class="blank"></div>
					</div>
					<div class="bottom"></div>
				</div>
			</div>
		</div>
		<jsp:include page="/page/front/footer.jsp"></jsp:include>
	</body>
</html>
